package com.opm.controller;

import com.opm.domain.User;
import com.opm.util.common.Constants;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

/**
 * @author chengang
 */
@Controller
public class ProjectController {

    @RequestMapping(value = "/project/add", method = RequestMethod.GET)
    public String add(Model model, Integer id) {
//        if (id != null) {
//            User job = rainservice.get_UserInfo(id);
//            model.addAttribute("job", job);
//        }
        return "/project/add";
    }

    @RequestMapping(value = "/project/add", method = RequestMethod.POST)
    public ModelAndView add(ModelAndView mv, @ModelAttribute User notice, Integer id) {
//        if (id != null) {
//            rainservice.update_UserInfo(notice);
//        } else {
//            rainservice.insert_UserInfo(notice);
//        }
        mv.setViewName("redirect:/user/list");
        return mv;
    }
}
